<template>
  <div class="login-setting">
    <el-form
      ref="userForm"
      :model="userInfo"
      label-width="120px"
      style="margin-left: 120px; margin-top: 30px"
    >
      <el-form-item label="姓名:">
        <el-input v-model="userInfo.username" style="width:300px" />
      </el-form-item>

      <el-form-item label="密码:">
        <el-input v-model="userInfo.password" type="password" style="width:300px" />
      </el-form-item>

      <el-form-item>
        <el-button type="primary" @click="saveuser">更新</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import {getusephotoid,saveUserDetailByIdAPI} from '../../../api/login-setting'
export default {
  name: 'LoginSetting',
  data() {
    return {
      userInfo: {
        username: '',
        password: ''
      }

    }
  },
  created(){
      this.getusephotoidfn()
  },
   methods: {
    async  getusephotoidfn(){
        const res=await getusephotoid(this.$route.query.id)
     // console.log(res.data.data);
        this.userInfo=res.data.data
      },
      async saveuser(){
        const res=await saveUserDetailByIdAPI(this.userInfo)
        // console.log(res);
        this.$message.success(res.data.message)
      }
    },
  

}
</script>

<style lang="scss" scoped></style>